 %include header libraryName=libraryName
    <script type="text/javascript">
        //<!--
        $(document).ready(function() {
            $('#name').focus();
        })
        //-->
    </script>
    <h2>User Management ({{len(users)}} users registered)</h2>
    <h3>{{message}}</h3>
    
    <a href="/administration">Administration Home</a>
    <div class="bordered">
        <form name="add_user_form" method="post" action="/administration/addUser">
            <div>
                <label for="name">Name: <input id="name" name="name" type="text" /></label>
                <label for="username">Username: <input name="username" type="text" /></label>
                <label for="password">Password: <input name="password" type="password" /></label>
            </div>
            <div>
                <label for="street">Street: <input name="street" type="text" /></label>
                <label for="city">City: <input name="city" type="text" /></label>
                <label for="state">State: <input name="state" type="text" /></label>
                <label for="zip">Zip: <input name="zip" type="text" /></label>
            </div>
            <div>
                <label for="phone">Phone: <input name="phone" type="text" /></label>
                <label for="email">E-mail: <input name="email" type="text" /></label>
            </div>
            <button type="submit">Add User</button>
        </form>
        
        <hr />
        
        <table width="100%">
            <thead>
                <tr>
                    <th />
                    <th />
                    <th>Name</th>
                    <th>Address</th>
                    <th>Phone</th>
                    <th>E-mail</th>
                </tr>
            </thead>
            <tbody>
            %for i, user in zip(range(len(users)), users):
                <tr>
                  <td><a href="manageUser/{{user.get('id')}}"><button>Edit</button></a></td>
                  <td><a href="deleteUser/{{user.get('id')}}"><button>Delete</button></a></td>
                  <td>{{user.get('name', '').encode('utf-8')}}</td>
                  <td>{{(u'%s %s, %s %s' % (user.get('street', ''), user.get('city', ''), user.get('state', ''), user.get('zip', ''))).encode('utf-8')}}</td>
                  <td>{{user.get('phone', '')}}</td>
                  <td>{{user.get('email', '')}}</td>
                </tr>
            %end
            </tbody>
        </table>
        <div><a href="/logout">Logout</a></div>
    </div>
%include footer
